(function() {
  var __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  define(['controllers/base/controller', 'views/user/login_view', 'views/user/index_view', 'views/user/form_view', 'models/user_model', 'collections/user_collection', 'daos/access_dao', 'daos/user_dao', 'lib/dao_factory'], function() {
    'use strict';
    var AccessDAO, Controller, DaoFactory, FormView, IndexView, LoginView, MainController, UserCollection, UserDAO, UserModel, _ref;
    Controller = require('controllers/base/controller');
    UserModel = require('models/user_model');
    UserCollection = require('collections/user_collection');
    LoginView = require('views/user/login_view');
    DaoFactory = require('lib/dao_factory');
    IndexView = require('views/user/index_view');
    FormView = require('views/user/form_view');
    AccessDAO = DaoFactory.getDAOByName('access_dao');
    UserDAO = DaoFactory.getDAOByName('user_dao');
    return MainController = (function(_super) {
      __extends(MainController, _super);

      function MainController() {
        _ref = MainController.__super__.constructor.apply(this, arguments);
        return _ref;
      }

      MainController.prototype.beforeAction = function() {
        MainController.__super__.beforeAction.apply(this, arguments);
        return this.model = new UserModel;
      };

      MainController.prototype.index = function() {
        return console.log(this.globals.userData);
      };

      MainController.prototype._setupHistoryBack = function() {
        var _this = this;
        return this.view.on('model:saved', function() {
          _this.publishEvent('feedback:success', 'Usuário salvo com sucesso');
          return _this.redirectTo({
            url: 'usuario'
          });
        });
      };

      return MainController;

    })(Controller);
  });

}).call(this);
